home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / AppleScript / Development Tools / Interfaces / AppleScript 1.1 Interfaces / PInterfaces / OSAGeneric.p < prev   
Encoding:
Text File  |  1994-04-08  |  3.4 KB  |  108 lines  |  [TEXT/MPS ]

  1. {
  2.     OPEN SCRIPTING ARCHITECTURE: Generic Component Interface
  3.     OSAGeneric.p
  4.  
  5.     Copyright Apple Computer, Inc. 1992-1993
  6.     Authors: Jens Alfke, William Cook, Donn Denman, and Warren Harris
  7.  
  8.     This interface defines a "generic scripting component."
  9.     The Generic Scripting Component allows automatic dispatch to a
  10.     specific scripting component that conforms to the OSA interface.
  11.     This component supports OSA, by calling AppleScript or some other 
  12.     scripting component.  Additionally it provides access to the default
  13.     and the user-prefered scripting component.
  14. }
  15.  
  16. {$IFC UNDEFINED UsingIncludes}
  17. {$SETC UsingIncludes := 0}
  18. {$ENDC}
  19.  
  20. {$IFC NOT UsingIncludes}
  21.     UNIT OSAGeneric;
  22.     INTERFACE
  23. {$ENDC}
  24.  
  25. {$IFC UNDEFINED UsingOSAGeneric}
  26. {$SETC UsingOSAGeneric := 1}
  27.  
  28. {$I+}
  29. {$SETC OSAGenericIncludes := UsingIncludes}
  30. {$SETC UsingIncludes := 1}
  31. {$IFC UNDEFINED UsingOSA}
  32. {$I $$Shell(PInterfaces)OSA.p}
  33. {$ENDC}
  34. {$SETC UsingIncludes := OSAGenericIncludes}
  35.  
  36.  
  37. { Types and Constants }
  38. CONST
  39.     errOSAComponentMismatch            = -1761;    {Parameters are from 2 different components}
  40.     errOSACantOpenComponent            = -1762;    {Can't connect to scripting system with that ID}
  41.  
  42.     kGenericComponentVersion        = $0100;    {Component version this header file describes}
  43.  
  44.     {Selector values for special Generic Component routines:}
  45.     kGSSSelectGetDefaultScriptingComponent    = $1001;    { = kOSASelectComponentSpecificStart}
  46.     kGSSSelectSetDefaultScriptingComponent    = $1002;
  47.     kGSSSelectGetScriptingComponent            = $1003;
  48.     kGSSSelectGetScriptingComponentFromStored=$1004;
  49.     kGSSSelectGenericToRealID                = $1005;
  50.     kGSSSelectRealToGenericID                = $1006;
  51.     kGSSSelectOutOfRange                    = $1007;
  52.  
  53. TYPE
  54.     ScriptingComponentSelector    = OSType;
  55.     GenericID                    = OSAID;
  56.  
  57. { get and set the default scripting component }
  58. FUNCTION
  59. OSAGetDefaultScriptingComponent( genericScriptingComponent    : ComponentInstance;
  60.                                  VAR scriptingSubType        : ScriptingComponentSelector){ out }
  61.     : OSAError;
  62.     INLINE $2F3C, $0004, $1001, $7000, $A82A;
  63.     
  64. FUNCTION 
  65. OSASetDefaultScriptingComponent( genericScriptingComponent    : ComponentInstance;
  66.                                   scriptingSubType            : ScriptingComponentSelector)
  67.     : OSAError;
  68.     INLINE $2F3C, $0004, $1002, $7000, $A82A;
  69.  
  70. { get a scripting component instance from its subtype code }
  71. FUNCTION 
  72. OSAGetScriptingComponent( genericScriptingComponent    : ComponentInstance;
  73.                           scriptingSubType            : ScriptingComponentSelector;
  74.                            VAR scriptingInstance        : ComponentInstance)                { out }
  75.     : OSAError;
  76.     INLINE $2F3C, $0008, $1003, $7000, $A82A;
  77.  
  78. { get a scripting component selector (subtype) from a stored script }
  79. FUNCTION 
  80. OSAGetScriptingComponentFromStored( genericScriptingComponent    : ComponentInstance;
  81.                                     scriptData                    : AEDesc;
  82.                                     VAR scriptingSubType        : ScriptingComponentSelector){ out }
  83.     : OSAError;
  84.     INLINE $2F3C, $0008, $1004, $7000, $A82A;
  85.  
  86. { get a real component instance and script id from a generic id }
  87. FUNCTION 
  88. OSAGenericToRealID( genericScriptingComponent    : ComponentInstance;
  89.                     VAR theScriptID                : OSAID;                                { in/out }
  90.                     VAR theExactComponent        : ComponentInstance )                    { out }
  91.     : OSAError;
  92.     INLINE $2F3C, $0008, $1005, $7000, $A82A;
  93.  
  94. { get a generic id from a real component instance and script id }
  95. FUNCTION 
  96. OSARealToGenericID( genericScriptingComponent    : ComponentInstance;
  97.                     VAR theScriptID                : OSAID;                                { in/out }
  98.                     theExactComponent            : ComponentInstance )
  99.     : OSAError;
  100.     INLINE $2F3C, $0008, $1006, $7000, $A82A;
  101.  
  102.  
  103. {$ENDC}    { UsingOSAGeneric }
  104.  
  105. {$IFC NOT UsingIncludes}
  106.     END.
  107. {$ENDC}
  108.